<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
    <title></title>
	<include file="public/reference"/>
    <script type="text/javascript">
        var alert = function (content)
        {
            $.ligerDialog.alert(content);
        };
        function itemclick(item)
        {
        	switch (item.type){
        		case 'add':
        			window.top.addTab('user_add','添加前台用户','__URL__/edit#add');
        			break;
        		case 'update':
        			gridManager.getSelectedRowObjs();
        			window.top.addTab('user_update','修改前台用户','__URL__/edit/id/'+);
        			break;
        		default:
        			break;
        	}
        }
        var gridManager = null;
        $(function ()
        {
            //表格
            $("#maingrid").ligerGrid({
                columns: [
	                { display: '登录名', name: 'username',align: 'left',width:100,minWidth: 60 },
	                { display: '姓名', name: 'name',width:100, minWidth: 60 },
	                { display: '角色', name: 'role',width:100, minWidth: 60 },
	                { display: '学校', name: 'school',width:100,  minWidth: 60 },
	                { display: '状态', name: 'state',width:100,  width:60,minWidth: 60 }
                ], 
                url:'__URL__/data',width: '100%', height: '100%', pageSize: 20,rownumbers:true,
                toolbar: { items: [
	                { text: '增加', click: itemclick,type:'add', icon: 'add' },
	                { line: true },
	                { text: '修改', click: itemclick,type:'update', icon: 'modify' },
	                { line: true },
	                { text: '通过', click: itemclick,type:'pass', icon:'true' },
	                { line: true },
	                { text: '锁定', click: itemclick,type:'lock', icon:'lock' },
	                { line: true },
	                { text: '删除', click: itemclick,type:'del', icon:'delete' }
                ]},
                checkbox : true,
                heightDiff: -6
            });
            gridManager = $("#maingrid").ligerGetGridManager();
            //搜索表单
			var searchForm=$('#searchForm').ligerForm({
                inputWidth: 140, labelWidth:60, space: 20,align:'left',labelAlign: 'right',
                 fields: [
	                { display: "登录名", name: "username", newline: false, type: "text"}, 
	                {name: "username_exp", type: "hidden",options:{value:'like'}}, 
	                
	                { display: "姓名", name: "name", newline: false, type: "text"},
	                {name: "name_exp", type: "hidden",options:{value:'like'}},
	                
	                { display: "邮箱", name: "email", newline: false, type: "text"},
	                {name: "email_exp", type: "hidden",options:{value:'like'}},
	                
	                { display: "学校", name: "school_id",comboboxName:'school_id', newline: false, type: "select", options: {
	                		data:{$schoolList},valueField : 'id',textField: 'name' } },
	                {name: "school_id_exp", type: "hidden",options:{value:'eq'}},
	                
	                { display: "状态", name: "state",comboboxName:'state', newline: false, type: "select", options: {
	                		data:userStateList,valueField : 'id',textField: 'name' } },
	                {name: "state_exp", type: "hidden",options:{value:'eq'}},
	                
	                { display: "排序", name: "orderBy",comboboxName:'orderBy', newline: false, type: "select",options: {
	                		data:sortList,valueField : 'id',textField: 'name'} }
                ]
			});
			$('#searchForm>.l-form-container>ul').append("<input type='button' id='searchbtn' class='l-fieldcontainer' value='搜索'/>");
            //搜索
            $("#searchbtn").ligerButton({ click: function (){
	                gridManager.setOptions(
	                    { parms: searchForm.getData() }
	                );
	                gridManager.loadData(true);
            	}
        	}); 

            $("#pageloading").hide();
        });

    </script>
</head>
<body style="padding:0px; overflow:hidden;"> 
<div class="l-loading" style="display:block" id="pageloading"></div> 
  <div id="form1"> 
	<div id="searchForm" style="display: inline;"></div>
    <div id="maingrid" style="margin:0; padding:0"></div>
  </div>


<div style="display:none;">
</div>
 
</body>
</html>
